<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/html/axios.min.js"></script>
    <script src="/html/util.js"></script>
    <script>
        function adduser() {
            axios.get("/user/register", {
                params: {
                    code: $('code').value,
                    mail: $('mail').value,
                    face: $('face').value
                }
            }).then(e => {
                if (e.data == 'ok') {
                    location.href = "/html/main.html"
                } else {
                    $('registerSpan').innerHTML = '注册失败';
                }
            })
        }
    </script>
    <style>
        img{
            width: 50px;
            height: 50px;
        }
    </style>
</head>
<body>
    <span style="color: red" id="registerSpan"></span><br>
    用户名:<input type="text" id="code"><br>
    用户邮件:<input type="email" id="mail"><br>
    头像:<input type="radio" name="face" value="img/1.jpg" checked class="imgClass" id="face"><img src="img/1.jpg">
    <input type="radio" name="face" value="img/2.jpg" class="imgClass"><img src="img/2.jpg">
    <input type="radio" name="face" value="img/3.jpg" class="imgClass"><img src="img/3.jpg">
    <input type="radio" name="face" value="img/4.jpg" class="imgClass"><img src="img/4.jpg"><br>
    <input type="button" value="注册" onclick="adduser()">
</body>
</html>